package com.eedi.framework.org.dal.mapper;

import com.eedi.framework.common.enums.CommonStatusEnum;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.framework.org.dal.dataobject.SysOrgConfigGuidanceDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SysOrgConfigGuidanceMapper extends BaseMapperX<SysOrgConfigGuidanceDO> {
    default SysOrgConfigGuidanceDO selectByGuidanceId(String orgConfigId, String orgConfigGuidanceId){
        LambdaQueryWrapperX<SysOrgConfigGuidanceDO> queryWrapper = new LambdaQueryWrapperX<>();
        queryWrapper.eq(SysOrgConfigGuidanceDO::getOrgConfigId, orgConfigId)
                .eq(SysOrgConfigGuidanceDO::getOrgConfigGuidanceId, orgConfigGuidanceId)
                .eq(SysOrgConfigGuidanceDO::getGuidanceStatus, CommonStatusEnum.ENABLE)
                .orderByAsc(SysOrgConfigGuidanceDO::getGuidanceSort);
        return this.selectOne(queryWrapper);
    }

}
